﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HalalCheck.Resources;
using HalalCheck.ViewModels;
using SpotOffer.Resource;
using Xamarin.Forms;

namespace HalalCheck.DataModels
{
    public class HalalItem
    {
   
        public string Id { get; set; }

        public string Name { get; set; }
        private int _halal;
        public int Halal
        {
            get { return _halal; }
            set
            {
                if (value != null)
                {
                    _halal = value;
                    _halaltext = GetHalalStatusString(_halal);
                }
            }
        }

        private Color _halalColor;
        public Color HalalColor
        {
            /*get { return _halalColor; }
            set
            {
                _halalColor = value;                           
            }*/
            get { return GetHalalColor(Halal); }

        }

        private string _halaltext;


        public string HalalText
        {
            get { return _halaltext; }
            set
            {
                if (value != null)
                {
                    _halaltext = value;
                }
            }
        }

        public static string GetHalalStatusString(int status)
        {
            switch (status)
            {
                case 0:
                    return HalalStrings.Halal;
                case 1:
                    return HalalStrings.Mushbooh;
                case 2:
                    return HalalStrings.Haram;
                default:
                    return HalalStrings.Halal;
            }
        }

        public string Description { get; set; }

        public Color GetHalalColor(int status)
        {
            switch (status)
            {
                case 0:
                    return AppColors.Green;
                case 1:
                    return AppColors.DarkGrey;
                case 2:
                    return AppColors.Red;
                default:
                    return AppColors.Green;
            }
        }

        public bool Checked { get; set; }

    
    }
}
